Skip to content

feat(src): support crypto market#217

Merged
lwaekfjlk merged 24 commits intomainfrom
feat/crypto
Nov 13, 2025
Merged

feat(src): support crypto market#217
lwaekfjlk merged 24 commits intomainfrom
feat/crypto

Conversation

@andrewBatutin
Copy link
Collaborator

@andrewBatutin andrewBatutin commented Oct 27, 2025

🪙 BitMEX Crypto Trading System

New Features

Trading System

  • New market type: Perpetual contract trading for 15+ cryptocurrencies
  • Synchronized trading: Daily at 3 PM ET (Mon-Fri), aligned with stock market schedule
  • Paper trading: $1,000 initial capital per agent
    Crypto-specific metrics:
  • Funding rates (8-hour carry costs)
    • live_trade_bench/systems/bitmex_system.py:152-153 - Funding rate fetching
    • live_trade_bench/agents/bitmex_agent.py:55-58 - Funding rate in LLM prompts
  • Order book depth (liquidity analysis)
    • live_trade_bench/systems/bitmex_system.py:157-165 - Bid/ask depth calculation
    • live_trade_bench/fetchers/bitmex_fetcher.py - Order book API integration
  • Open interest tracking
    • live_trade_bench/systems/bitmex_system.py:181 - Open interest data
    • live_trade_bench/agents/bitmex_agent.py:55-58 - Open interest display
  • Mark price with 10-day history
    • live_trade_bench/fetchers/bitmex_fetcher.py:199 - Price history fetching
    • live_trade_bench/systems/bitmex_system.py:145-150 - Historical price integration

🔧 Backend Infrastructure

Trading Cycles:

  • BitMEX system integrated into production scheduler - backend/app/main.py:265-275
  • Synchronized with stock/polymarket at 3 PM ET (Mon-Fri) - backend/app/main.py:269
  • 10-minute price updates during market hours only - backend/app/main.py:305-311,
    backend/app/price_data.py:534-540

Data Pipelines:

  • News fetching for crypto (Google News) - live_trade_bench/fetchers/news_fetcher.py:167,
    live_trade_bench/systems/bitmex_system.py:229-252
  • Social media monitoring (Reddit) - live_trade_bench/fetchers/reddit_fetcher.py,
    live_trade_bench/systems/bitmex_system.py:265-328
  • Price updates with BitMEX API - backend/app/price_data.py:524-559,
    live_trade_bench/fetchers/bitmex_fetcher.py
  • Market hours enforcement - backend/app/price_data.py:534-540

API Endpoints:

  • /api/news/{market_type} - BitMEX supported - backend/app/routers/news.py:13
  • /api/social/{market_type} - BitMEX supported - backend/app/routers/social.py:13
  • BitMEX data integrated into models and system endpoints

🎨 Frontend Integration

UI Components:

  • BitMEX tabs added to News and SocialMedia pages
  • Crypto-specific color theming in allocation charts
  • BitMEX dashboard support (routing ready)

🧪 Backtesting Enhancements

Updated examples/backtest_demo.py:

  • BitMEX support added alongside stock/polymarket
  • Parallel backtesting for all three markets
  • Crypto benchmark models (BTC-HOLD, ETH-HOLD)
  • All 21 models tested (removed flagship-only filter)

🔧 System Reliability

  • Synchronized schedules: All trading systems update together at 3 PM ET
Screenshot 2025-11-08 at 14 29 23 Screenshot 2025-11-08 at 14 30 06

@andrewBatutin andrewBatutin marked this pull request as ready for review November 8, 2025 13:46
@andrewBatutin andrewBatutin changed the title [WIP] feat/crypto feat/crypto Nov 8, 2025
@lwaekfjlk
Copy link
Member

lwaekfjlk commented Nov 11, 2025

Hi @andrewBatutin , sorry for the delayed review. I was a little bit busy during the weekends. The PR looks amazingly good. But there are still some details that need to be fixed. Could you take a look at those comments?

@andrewBatutin
Copy link
Collaborator Author

Hi @andrewBatutin , sorry for the delayed review. I was a little bit busy during the weekends. The PR looks amazingly good. But there are still some details that need to be fixed. Could you take a look at those comments?

Hi i've fixed the comments

@lwaekfjlk lwaekfjlk changed the title feat/crypto feat(src): support crypto market Nov 13, 2025
@lwaekfjlk lwaekfjlk merged commit b0bc0b4 into main Nov 13, 2025
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants